#pragma once

#include <cv.h>
#include <highgui.h>
#include <string>
#include <iostream>

class DebugImage
{
public:
	DebugImage(IplImage* i, const std::string &window) :img(i), win(window) {
		std::cout << "Hit a key to show \"" << win << "\"" << std::endl;
		cvWaitKey();
		cvNamedWindow(win.c_str());
		cvShowImage(win.c_str(), img);
	}

	~DebugImage(void) {
		std::cout << "Hit a key to update \"" << win << "\"" << std::endl;
		cvWaitKey();
		cvShowImage(win.c_str(), img);
	}
private:
	IplImage* img;
	std::string win;
};
